package day3.Exer;

import java.util.Scanner;

public class Degreetest {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Degreeclass a = new Degreeclass();
        a.name = "78班";
        a.headteacher = "李老师";
        a.date = "2022.1.1";
        a.num = 0;
        String answer="y";
        while (answer.equals("y")) {
            System.out.println("请输入学生姓名：");
            String stname=in.next();
            a.add(stname);
            a.num++;
            System.out.println("是否继续输入？y/n");
            answer=in.next();

        }
        a.showinfo();
    }
}
